<?php
if(!defined('ADMIN')){
	exit('Access Denied');
}
$file_list=upload("image");

if(is_numeric($file_list)){
    jumpajax('300','上传失败，错误编码：'.$file_list,'');
}

/*
$data=array(
"filename"=>$file_list["filename"],
"filepath"=>$file_list["saved_upload_name"],
"filesize"=>$file_list["attachmentSize"],
"isimage"=>$file_list["is_image"],
"fileext"=>$file_list["file_extension"],
"userid"=>$_SESSION['EZ_Admin']['id'],
"uploadtime"=>time(),
"uploadip"=>get_client_ip()

);
$id=$ezhand->insert("attachment",$data);
*/

$data=array(
"filename"=>$file_list["filename"],
"attachment"=>$file_list["saved_upload_name"],
"type"=>$file_list["is_image"],
"weid"=>$_SESSION['EZ_Admin']['id'],
"uid"=>$_SESSION['EZ_Admin']['id'],
"createtime"=>time()
);
$id=$ezhand->insert("attachment",$data);

$reslist=array("id"=>$id,"fileName"=>$file_list["saved_upload_name"],"attachmentPath"=>$file_list["saved_upload_name"],"attachmentSize"=>$file_list["attachmentSize"]);
echo json_encode($reslist);

?>